#include "DeviceSelectionDialog.h"

DeviceSelectionDialog::DeviceSelectionDialog(QWidget* parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
	ui.setupUi(this);
	connect(ui.comboBox, SIGNAL(activated(const QString&)), this, SLOT(deviceSelected(const QString&)));
}

DeviceSelectionDialog::~DeviceSelectionDialog()
{
}

void DeviceSelectionDialog::addDevice(const QString& name)
{
	ui.comboBox->addItem(name);
	if(m_selectedName.isEmpty())
		m_selectedName = name;
}

void DeviceSelectionDialog::deviceSelected(const QString& name)
{
	m_selectedName = name;
}